const mongoose = require('mongoose');
const { ObjectId } = mongoose.Schema;

module.exports = {
  projectId: ObjectId,
  versionId: ObjectId,
  fileId: ObjectId,
  functionId: {
    type: ObjectId,
    index: true,
  },
  path: [ObjectId],
  number: Number,
  description: String,
  children: [{
    _id: false,
    id: ObjectId,
    childType: String, // 测试用例：testcase,编组：group
  }],
  statementCovered: { type: Number, default: 0 },
  branchCovered: { type: Number, default: 0 },
  conditionCovered: { type: Number, default: 0 },
  decisionCovered: { type: Number, default: 0 },
  mcdcCovered: { type: Number, default: 0 },
  invokedFuncCovered: { type: Number, default: 0 },
  invokeCovered: { type: Number, default: 0 },
};
